package ua.edu.nuos.tees.jdmmon.bl.timer;

import jssc.SerialPortException;
import ua.edu.nuos.tees.jdmmon.bl.MultimeterService;

import java.io.IOException;
import java.util.TimerTask;

/**
 * @author Timur Yarosh
 *         Date: 30.05.13
 *         Time: 22:07
 */
public class RefreshTask extends TimerTask {
    private MultimeterService service;

    public RefreshTask(MultimeterService service) {
        this.service = service;
    }

    @Override
    public void run() {
        try {
            service.refreshData();
        } catch (InterruptedException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (SerialPortException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }
}
